<?php
/// ------------
/// | ThinkPHP [ WE CAN DO IT JUST THINK IT ]
/// ------------
/// | Copyright (c) 2006-2012 http:///thinkphp.cn All rights reserved.
/// ------------
/// | Licensed ( http:///www.apache.org/licenses/LICENSE-2.0 )
/// ------------
/// | Author: liu21st <liu21st@gmail.com>
/// ------------
/// $Id: Behavior.class.php 2702 2012-02-02 12:35:01Z liu21st $

/**
 * ThinkPHP Behavior基础类，如果未重写rum方法则自动调用action_name的同名方法
 * @category   Think
 * @package  Think
 * @subpackage  Util
 * @author liu21st <liu21st@gmail.com>
 * @version  $Id: Behavior.class.php 2702 2012-02-02 12:35:01Z liu21st $
 */
abstract class Status {

    /// 行为参数 和配置参数设置相同
    protected $options =  array();

    protected $td;
    
    public function __construct(){
    	$this->db     =   Db::getInstance();
    }
    
    public function __call($method,$params){
    	exit('状态类方法：“'.$method.'”不存在！');
    }
       
    /// 获取行为参数
    public function __get($name){
        return $this->options[strtolower($name)];
    }

    /**
     * 执行行为 run方法是Behavior唯一的接口
     * @access public
     * @param mixed $params  行为参数
     * @param mixed $params  执行方法名称
     * @return void
     *//// 状态更新类唯一入口update
	public function run($params,$method) {
		empty($method) && $method = MODULE_NAME;
		$this->$method($params);
	}

}